var arr = [10,7,65,5,12,33];

var min = arr[0];
var max = arr[0];

for (var i =1;i<arr.length;i++){
    if(arr[i] > max){
        max = arr[i];
    }
    if(arr[i] < min){
        min = arr[i];
    }
}

console.log("最小值" +min);
console.log("最大值" +max);